<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__ROOT__/layui/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="__ROOT__/layui/css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main" style="height: 700px">

        <div style="padding: 20px;background-color:white">
            <div style="margin-bottom: 20px;padding-bottom: 40px">
                <button type="button" class="layui-btn layui-bg-blue" style="float: right" id="add_tag">
                    <i class="layui-icon layui-icon-add-1"></i>添加标签
                </button>
            </div>
            {foreach name="list" item="vo" }
                <!--    卡片开始-->
                <div class="layui-card" style="float: left;">
                    <!--        <div class="layui-card-header" style="font-weight: bold">{$vo.name}</div>-->
                    <div style="margin-left: 50px;margin-top: 10px;font-weight: bold;font-size: 20px"> {$vo.name}</div>
                    <!--        <blockquote class="layui-elem-quote layui-quote-nm">-->
                    <!--          {$vo.name}-->
                    <!--        </blockquote>-->
                    <div class="layui-card-body" >
                        <div class="layui-field-box" >
                            <div class="layui-btn-container" >

                                {foreach name="vo['detail']" item="v" }
                                    <div style="width: 180px;float: left;margin-left: 20px;margin-right: 20px">
                                        <button class="layui-btn layui-btn-sm layui-btn-primary layui-border-blue layui-btn-fluid update"  id="{$v.id}">{$v.name}<i class="layui-icon layui-icon-edit"></i> </button>
                                    </div>

                                {/foreach}
                            </div>
                        </div>
                    </div>
                </div>
                <!--    卡片结束-->
            {/foreach}
        </div>
    </div>
</div>
<script src="__ROOT__/static/assets/js/jquery-2.1.4.min.js" charset="utf-8"></script>
<script src="__ROOT__/layui/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    $("#add_tag").on("click", function(){
        //iframe层
        layer.open({
            type: 2,
            title: '添加标签',
            shadeClose: true,
            shade: 0.6,
            anim: 0, // 0-6 的动画形式，-1 不开启
            maxmin: true, //开启最大化最小化按钮
            area: ['800px', '600px'],
            content:[ '{:url(\'Tag/add\')}']
        });
    });

    $(".update").on("click", function(){
        var id = $(this).attr("id");
        //iframe层
        layer.open({
            type: 2,
            title: '修改标签',
            shadeClose: true,
            shade: 0.6,
            anim: 0, // 0-6 的动画形式，-1 不开启
            maxmin: true, //开启最大化最小化按钮
            area: ['800px', '600px'],
            content:'/index/tag/update?id='+id,
        });
    });

</script>

</body>
</html>